# mun = 3
# def fun():
#     mun = 5
#     print('函数内局部变量mun的值： ',mun)
# fun()
# print('函数外全部局变量mun的值： ',mun)

# num = 5
# def fun():
#     global num
#     num += 1
#     print('函数内num的值：',num)
# fun()
# print('函数外num的值： ',num)


# def outer():
#     num = 1
#     def inner():
#         nonlocal num
#         num = 2
#         print('inner函数中num的值：',num)
#     inner()
#     print('outer函数中num的值：',num)
# outer()

stu = [{'num':'201801','name':'老六','score':96},
       {'num':'201802','name':'老七','score':93},
        {'num':'201803','name':'老八','score':82}]
stu.sort(key=lambda x: x['score'])
for s in  stu:
    print('学号：',s['num'],'姓名:',s['name'],'成绩：',s['score'])